//
//  ViewController.m
//  13---Homework 简书发现页面
//
//  Created by 冀永金 on 16/8/1.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ViewController.h"
#import "MyTableViewCell.h"
@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UIButton *seachButton;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic) IBOutlet UIView *headerView;
@property (nonatomic, strong) NSMutableArray *marrOfName;
@property (nonatomic, strong) NSMutableArray *marrOfTime;
@property (nonatomic,strong) NSMutableArray *marrOfDescription;
@property (nonatomic, strong) NSMutableArray *readMarr;
@property (nonatomic, strong) NSMutableArray *marrOfImage;
@property (nonatomic, strong) NSMutableArray *marrOfSmallImage;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.seachButton.layer.cornerRadius = 10;
    [self.seachButton.layer setBorderWidth:2];
    self.seachButton.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.marrOfName = @[@"终身美丽的猪",@"弘丹"].mutableCopy;
    self.marrOfTime = @[@"5小时前",@"7小时前"].mutableCopy;
    self.marrOfDescription = @[@"关于写作，这本书可以让你事半功倍",@"真正的沟通高手，都是懂自己的"].mutableCopy;
    self.readMarr = @[@"阅读5059，评论74，喜欢338",@"阅读5050，评论70，喜欢308"].mutableCopy;
    self.marrOfSmallImage = @[@"1",@"2"].mutableCopy;
    //self.tableView.tableHeaderView = _headerView;
    // Do any additional setup after loading the view, typically from a nib.
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"pool" forIndexPath:indexPath];
    cell.nameLabel.text = self.marrOfName [indexPath.row];
    cell.timeLabel.text = self.marrOfTime[indexPath.row];
    cell.descriptionLabel.text = self.marrOfDescription[indexPath.row];
    cell.thinkLabel.text = @"想法";
    cell.readLabel.text = self.readMarr[indexPath.row];
    cell.samllImage.layer.cornerRadius = self.view.frame.size.width / 28;
    cell.samllImage.clipsToBounds = YES;
    cell.samllImage.image = [UIImage imageNamed:self.marrOfSmallImage[indexPath.row]];
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
